package com.nts.visionworks.business.schedule.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import com.nts.visionworks.business.contents.domain.Contents;
import com.nts.visionworks.core.validation.EntityIdNotNull;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Min;

/**
 * ScheduleStageDivision generated by hbm2java
 */
@Entity
@Table(name = "schedule_stage_division", catalog = "visionworks")
public class ScheduleStageDivision implements java.io.Serializable
{

	private Long divisionId;
	private ScheduleContentsStage scheduleContentsStage;
	private int division;
	private int leftCoordinate;
	private int topCoordinate;
	private int width;
	private int height;
	private Set<Contents> contentses = new HashSet<Contents>(0);

	public ScheduleStageDivision()
	{
	}

	public ScheduleStageDivision(ScheduleContentsStage scheduleContentsStage,
			int division, int leftCoordinate, int topCoordinate, int width,
			int height)
	{
		this.scheduleContentsStage = scheduleContentsStage;
		this.division = division;
		this.leftCoordinate = leftCoordinate;
		this.topCoordinate = topCoordinate;
		this.width = width;
		this.height = height;
	}

	public ScheduleStageDivision(ScheduleContentsStage scheduleContentsStage,
			int division, int leftCoordinate, int topCoordinate, int width,
			int height, Set<Contents> contentses)
	{
		this.scheduleContentsStage = scheduleContentsStage;
		this.division = division;
		this.leftCoordinate = leftCoordinate;
		this.topCoordinate = topCoordinate;
		this.width = width;
		this.height = height;
		this.contentses = contentses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "DivisionId", unique = true, nullable = false)
	public Long getDivisionId()
	{
		return this.divisionId;
	}

	public void setDivisionId(Long divisionId)
	{
		this.divisionId = divisionId;
	}

	@EntityIdNotNull(message = "validation.scheduleStageDivision.scheduleContentsStage.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "StageId", nullable = false)
	public ScheduleContentsStage getScheduleContentsStage()
	{
		return this.scheduleContentsStage;
	}

	public void setScheduleContentsStage(
			ScheduleContentsStage scheduleContentsStage)
	{
		this.scheduleContentsStage = scheduleContentsStage;
	}

	@Min(message = "validation.scheduleStageDivision.division.min", value = 1)
	@Column(name = "Division", nullable = false)
	public int getDivision()
	{
		return this.division;
	}

	public void setDivision(int division)
	{
		this.division = division;
	}

	@Min(message = "validation.scheduleStageDivision.leftCoordinate.min", value = 0)
	@Column(name = "LeftCoordinate", nullable = false)
	public int getLeftCoordinate()
	{
		return this.leftCoordinate;
	}

	public void setLeftCoordinate(int leftCoordinate)
	{
		this.leftCoordinate = leftCoordinate;
	}

	@Min(message = "validation.scheduleStageDivision.topCoordinate.min", value = 0)
	@Column(name = "TopCoordinate", nullable = false)
	public int getTopCoordinate()
	{
		return this.topCoordinate;
	}

	public void setTopCoordinate(int topCoordinate)
	{
		this.topCoordinate = topCoordinate;
	}

	@Min(message = "validation.scheduleStageDivision.width.min", value = 1)
	@Column(name = "Width", nullable = false)
	public int getWidth()
	{
		return this.width;
	}

	public void setWidth(int width)
	{
		this.width = width;
	}

	@Min(message = "validation.scheduleStageDivision.height.min", value = 1)
	@Column(name = "Height", nullable = false)
	public int getHeight()
	{
		return this.height;
	}

	public void setHeight(int height)
	{
		this.height = height;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "scheduleStageDivisions")
	public Set<Contents> getContentses()
	{
		return this.contentses;
	}

	public void setContentses(Set<Contents> contentses)
	{
		this.contentses = contentses;
	}

}
